home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / fax / src / etc / dialrules.sf-ba < prev    next >
Text File  |  1994-08-01  |  2KB  |  52 lines

  1. ! $Header: /usr/people/sam/fax/etc/RCS/dialrules.sf-ba,v 1.1 1993/05/06 11:34:29 sam Rel $
  2. !
  3. ! FlexFAX Dialing String Processing Rules
  4. !   for the San Francisco Bay Area.
  5. !
  6. ! This file describes how to process user-specified dialing strings
  7. ! to create two items:
  8. !
  9. ! CanonicalNumber: a unique string that is derived from all dialing
  10. ! strings to the same destination phone number.  This string is used
  11. ! by the fax server for ``naming'' the destination. 
  12. !
  13. ! DialString: the string passed to the modem for use in dialing the
  14. ! telephone.  This string should be void of any characters that might
  15. ! confuse the modem.
  16. !
  17. Area=${AreaCode}        ! local area code
  18. Country=${CountryCode}        ! local country code
  19. IDPrefix=${InternationalPrefix}    ! prefix for placing an international call
  20. LDPrefix=${LongDistancePrefix}    ! prefix for placing a long distance call
  21. !
  22. WS="     "            ! our notion of white space
  23. !
  24. ! Convert a phone number to a canonical format:
  25. !
  26. !    +<country><areacode><rest>
  27. !
  28. ! by (possibly) stripping off leading dialing prefixes for
  29. ! long distance and/or international dialing.
  30. !
  31. CanonicalNumber := [
  32. #.*            =            ! strip calling card stuff
  33. [^+0-9]+        =            ! strip white space etc.
  34. ^${IDPrefix}        = +            ! replace int. dialing code
  35. ^${LDPrefix}        = +${Country}        ! replace l.d. dialing code
  36. ^[^+]            = +${Country}${Area}&    ! otherwise, insert canon form
  37. ]
  38. !
  39. ! Process a dialing string according to local requirements.
  40. ! This may involve stripping local country and area codes,
  41. ! inserting dialing prefixes, etc.  In the SF bay area it is
  42. ! necessary to remove any long distance dialing information
  43. ! when calling a number in the same area code.
  44. !
  45. DialString := [
  46. [-${WS}.]+        =            ! strip syntactic sugar
  47. ^${LDPrefix}${Area}    =            ! local phone call
  48. ^[+]${Country}${Area}    =            ! local phone call
  49. ^[+]${Country}        = ${LDPrefix}        ! long distance call
  50. ^[+]            = ${IDPrefix}        ! international call
  51. ]
  52.